﻿using System;

namespace CSharp.Exam4
{
    class ArrayDemo
    {
        public static void Triangle()
        {
            Console.WriteLine("Enter Number of lines: ");
            int lines = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Triangle : ");
            string[][] triangle = new string[lines][];

            for (int i = 0; i < lines; i++)
            {
                triangle[i] = new string[i + 1];
                for (int j = 0; j < i + 1; j++)
                {
                    triangle[i][j] = "*";
                }
            }

            for (int i = 0; i < lines; i++)
            {
                for (int j = 0; j < i + 1; j++)
                {
                    Console.Write(triangle[i][j]);
                }
                Console.WriteLine();
            }
        }
    }
}
